/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Controllers;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner; 
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author wolf
 */
public class LoginController implements LoginInterface {
    @Override
    public void run() {
    Scanner scan = null;
        try {
            scan = new Scanner (new File("C:\\Users\\wolf\\Desktop\teo.txt"));
        } catch (FileNotFoundException ex) {
            Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);
        }
    String user = scan.nextLine();
    String pass = scan.nextLine(); // looks at selected file in scan
    
    Scanner keyboard = new Scanner (System.in);
    String inpUser = keyboard.nextLine();
    String inpPass = keyboard.nextLine(); // gets input from user

    if (inpUser.equals(user) && inpPass.equals(pass)) {
        System.out.print("Success Login");
    } else {
        System.out.print("Failed Login");
    }
}
    
   public static void main(String[] args) {
       new LoginController();

    }  
}


